<!doctype html>
<html>
<head>
  <title>Learning javascript</title>
  <meta charset="utf-8" />
  <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <style>
  </style>
</head>

<body>
<div>
  <input id="myInput" type="text"></input>
  <button id="styleChanger">Change the text!</button>
  <div id="firstDiv">This is some text!</div>
  <script type="text/javascript">
    document.getElementById("styleChanger").onclick=function(){
      var newText = document.getElementById("myInput").value;
      document.getElementById("firstDiv").innerHTML = newText;
    }
  </script>
</div>
</body>
</html>
